<script>

	$().ready(function() {
		// validate the comment form when it is submitted
		
		
		// validate signup form on keyup and submit
		$("#updateRappresentante").validate({
			rules: {
				datai: {
					required: true,
					date: true
					},
				dataf: {
					required: true,
					date: true
					}
					
			},
			messages: {
				datai: {
					required: "inserisci la data",
					date: "il formato non e' corretto"
				},
				dataf: {
					required: "inserisci la data",
					date: "il formato non e' corretto"
				}
			}
		});
	});	
	$(function()
			{
				$('.date-pick').datePicker({startDate:'01/01/1996'});
	});

</script>

<div id="page">
<div id="content">
<form method="get" id="updateRappresentante"
	action="<?php echo BASE_PATH;?>Rappresentante/Update_Rappresentante/?">
	
<fieldset><legend>Modifica rappresentante:</legend>
<ol>
	
	
	<li><label for="nome">Corso di laurea :</label>
	<input id=idcorso name="idcorso" type="hidden" value="<?php echo $vars[0][Fk_IdCorsoStudio]; ?>" />
	<input type="text" id="corsostudio" readonly="readonly" 
	value="<?php echo $vars[CorsoStudio]; ?>" />
	</li>
	
	<li><label for="nome">Matricola :</label>
	<input type="text" id="matricola" name="matricola" readonly="readonly"
	value="<?php echo $vars[0][FK_Matricola]; ?>" />
	</li>
	
	<li><label for="nome">Nome:</label>
		<input type="text" id="nome" name="nome" readonly="readonly" 
		value="<?php echo $vars[Studente][Nome]; ?>" />
	</li>
	<li><label for="nome">Cognome:</label>
		<input type="text" id="cognome" name="cognome" readonly="readonly" 
		value="<?php echo $vars[Studente][Cognome]; ?>" />
	</li>
	
	</li>
	<li><label for="date1">Data inizio mandato:</label>
		<input type="text" title="date" id="datai" name="datai" size="10" class="date-pick" 
		value="<?php echo $vars[0]['Data inizio mandato']; ?>"/>
	</li>
	<li><label for="date1">Data fine mandato:</label>
		<input type="text" title="date" id="dataf" name="dataf" size="10" class="date-pick" 
		value="<?php echo $vars[0]['Data fine mandato']; ?>"/>
	</li>
	
	<li><label for="nome">Anno Accademico:</label>
		<select id="annoaccademico" name="annoaccademico">
		<?php foreach ($vars['AnnoAccademico'] as $result){?>
    <option value="<?php echo $vars[0][Fk_IdAnno] ;?>"
    <?php if($result[IdAnno]==$vars[0][Fk_IdAnno]) echo 'selected=selected'; ?>>
    <?php echo $result['datainizio'].'/'.$result['datafine'];?></option>
  <?php }?>
		</select>
	</li>
  </ol>
  <br>
  <br>
		<input type="submit" id="invia" value="Modifica i dati">

</form>

</div>
</div>


